<template>
  <view class="content">
    <image class="logo" src="/static/logo.png"></image>
    <view class="text-area">
      <text class="title">{{ title }} - {{ pageTitle }}</text>
    </view>
  </view>
</template>

<script lang="ts">
import { reactive, onMounted, toRefs, nextTick, getCurrentInstance } from "vue";
import { getHome } from '../service/home.js'
let pageParmes:any = {}; // 接收页面参数
export default {
  components: {},
  name: "home",
  onLoad(options: any) {
    pageParmes = options
    console.log("index onLoad", pageParmes);
  },
  setup() {
    const data = reactive({
      title: "Hello",
      pageTitle: "pageTitleName",
    });
    // 接受到值必须在onMounted生命周期里面进行。
    onMounted(async () => {
      console.log("index onMounted", pageParmes);
      init();
      initTwo()
      const { data } = await getHome()
    }); // onMounted end
    const init = async () => {
      console.log("index init");
    };
    const initTwo =  () => {
      console.log("index initTwo");
    };
    return {
      ...toRefs(data),
    };
  },

  methods: {},
};
</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
